#include "Base.h"
#include "LobbyPlayer.h"
#include "DBProtocol.h"
#include "WorldServer.h"

CLobbyPlayer::CLobbyPlayer(void)
{
}

CLobbyPlayer::~CLobbyPlayer(void)
{
}

Msg* CLobbyPlayer::CreateMsg(DWORD dwMsgId, int nLen)
{
	switch(dwMsgId)
	{
	case Msg_LW_User_Login:
		return new LWUserLoginMsg;
	}
	return NULL;
}

BOOL CLobbyPlayer::OnMsg(Msg *pMsg)
{
	DWORD dwMsgId = pMsg->GetMsgId();
	switch(dwMsgId)
	{
	case Msg_LW_User_Login:
		{
            OnUserLogin((LWUserLoginMsg*)pMsg);
			break;
		}
	
	default:
		break;
	}
	return TRUE;
}

BOOL CLobbyPlayer::OnUserLogin(LWUserLoginMsg *pMsg)
{
	DWORD dwUserId = pMsg->m_dwUserId;
    g_pWorldServer->OnUserOnline(dwUserId, this);
	return TRUE;
}